package com.openbravo.pos.customers;

import com.openbravo.basic.BasicException;
import com.openbravo.data.gui.ComboBoxValModel;
import com.openbravo.data.loader.SentenceList;
import com.openbravo.data.user.DirtyManager;
import com.openbravo.data.user.EditorRecord;
import com.openbravo.format.Formats;
import com.openbravo.pos.forms.AppLocal;
import com.openbravo.pos.forms.AppView;
import com.openbravo.pos.forms.DataLogicSales;
import com.openbravo.pos.util.StringUtils;

import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.List;
import java.util.UUID;

import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.GroupLayout.ParallelGroup;
import javax.swing.GroupLayout.SequentialGroup;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTabbedPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.LayoutStyle;
import javax.swing.LayoutStyle.ComponentPlacement;
import javax.swing.text.Document;

public class CustomersView extends JPanel
  implements EditorRecord
{
  private Object m_oId;
  private SentenceList m_sentcat;
  private ComboBoxValModel m_CategoryModel;
  private DirtyManager m_Dirty;
  private JButton jButton2;
  private JButton jButton3;
  private JLabel jLabel1;
  private JLabel jLabel13;
  private JLabel jLabel14;
  private JLabel jLabel15;
  private JLabel jLabel16;
  private JLabel jLabel17;
  private JLabel jLabel18;
  private JLabel jLabel19;
  private JLabel jLabel2;
  private JLabel jLabel20;
  private JLabel jLabel21;
  private JLabel jLabel22;
  private JLabel jLabel23;
  private JLabel jLabel24;
  private JLabel jLabel3;
  private JLabel jLabel4;
  private JLabel jLabel5;
  private JLabel jLabel6;
  private JLabel jLabel7;
  private JLabel jLabel8;
  private JLabel jLabel9;
  private JPanel jPanel1;
  private JPanel jPanel2;
  private JPanel jPanel3;
  private JScrollPane jScrollPane1;
  private JTabbedPane jTabbedPane1;
  private JTextField jcard;
  private JComboBox m_jCategory;
  private JTextField m_jName;
  private JTextArea m_jNotes;
  private JTextField m_jSearchkey;
  private JTextField m_jTaxID;
  private JCheckBox m_jVisible;
  private JTextField txtAddress;
  private JTextField txtAddress2;
  private JTextField txtCity;
  private JTextField txtCountry;
  private JTextField txtCurdate;
  private JTextField txtCurdebt;
  private JTextField txtEmail;
  private JTextField txtFax;
  private JTextField txtFirstName;
  private JTextField txtLastName;
  private JTextField txtMaxdebt;
  private JTextField txtPhone;
  private JTextField txtPhone2;
  private JTextField txtPostal;
  private JTextField txtRegion;

  public CustomersView(AppView paramAppView, DirtyManager paramDirtyManager)
  {
    DataLogicSales localDataLogicSales = (DataLogicSales)paramAppView.getBean("com.openbravo.pos.forms.DataLogicSales");
    initComponents();
    this.m_sentcat = localDataLogicSales.getTaxCustCategoriesList();
    this.m_CategoryModel = new ComboBoxValModel();
    this.m_Dirty = paramDirtyManager;
    this.m_jTaxID.getDocument().addDocumentListener(paramDirtyManager);
    this.m_jSearchkey.getDocument().addDocumentListener(paramDirtyManager);
    this.m_jName.getDocument().addDocumentListener(paramDirtyManager);
    this.m_jCategory.addActionListener(paramDirtyManager);
    this.m_jNotes.getDocument().addDocumentListener(paramDirtyManager);
    this.txtMaxdebt.getDocument().addDocumentListener(paramDirtyManager);
    this.m_jVisible.addActionListener(paramDirtyManager);
    this.txtFirstName.getDocument().addDocumentListener(paramDirtyManager);
    this.txtLastName.getDocument().addDocumentListener(paramDirtyManager);
    this.txtEmail.getDocument().addDocumentListener(paramDirtyManager);
    this.txtPhone.getDocument().addDocumentListener(paramDirtyManager);
    this.txtPhone2.getDocument().addDocumentListener(paramDirtyManager);
    this.txtFax.getDocument().addDocumentListener(paramDirtyManager);
    this.txtAddress.getDocument().addDocumentListener(paramDirtyManager);
    this.txtAddress2.getDocument().addDocumentListener(paramDirtyManager);
    this.txtPostal.getDocument().addDocumentListener(paramDirtyManager);
    this.txtCity.getDocument().addDocumentListener(paramDirtyManager);
    this.txtRegion.getDocument().addDocumentListener(paramDirtyManager);
    this.txtCountry.getDocument().addDocumentListener(paramDirtyManager);
    writeValueEOF();
  }

  public void activate()
    throws BasicException
  {
    List localList = this.m_sentcat.list();
    localList.add(0, null);
    this.m_CategoryModel = new ComboBoxValModel(localList);
    this.m_jCategory.setModel(this.m_CategoryModel);
  }

  public void refresh()
  {
  }

  public void writeValueEOF()
  {
    this.m_oId = null;
    this.m_jTaxID.setText(null);
    this.m_jSearchkey.setText(null);
    this.m_jName.setText(null);
    this.m_CategoryModel.setSelectedKey(null);
    this.m_jNotes.setText(null);
    this.txtMaxdebt.setText(null);
    this.txtCurdebt.setText(null);
    this.txtCurdate.setText(null);
    this.m_jVisible.setSelected(false);
    this.jcard.setText(null);
    this.txtFirstName.setText(null);
    this.txtLastName.setText(null);
    this.txtEmail.setText(null);
    this.txtPhone.setText(null);
    this.txtPhone2.setText(null);
    this.txtFax.setText(null);
    this.txtAddress.setText(null);
    this.txtAddress2.setText(null);
    this.txtPostal.setText(null);
    this.txtCity.setText(null);
    this.txtRegion.setText(null);
    this.txtCountry.setText(null);
    this.m_jTaxID.setEnabled(false);
    this.m_jSearchkey.setEnabled(false);
    this.m_jName.setEnabled(false);
    this.m_jCategory.setEnabled(false);
    this.m_jNotes.setEnabled(false);
    this.txtMaxdebt.setEnabled(false);
    this.txtCurdebt.setEnabled(false);
    this.txtCurdate.setEnabled(false);
    this.m_jVisible.setEnabled(false);
    this.jcard.setEnabled(false);
    this.txtFirstName.setEnabled(false);
    this.txtLastName.setEnabled(false);
    this.txtEmail.setEnabled(false);
    this.txtPhone.setEnabled(false);
    this.txtPhone2.setEnabled(false);
    this.txtFax.setEnabled(false);
    this.txtAddress.setEnabled(false);
    this.txtAddress2.setEnabled(false);
    this.txtPostal.setEnabled(false);
    this.txtCity.setEnabled(false);
    this.txtRegion.setEnabled(false);
    this.txtCountry.setEnabled(false);
    this.jButton2.setEnabled(false);
    this.jButton3.setEnabled(false);
  }

  public void writeValueInsert()
  {
    this.m_oId = null;
    this.m_jTaxID.setText(null);
    this.m_jSearchkey.setText(null);
    this.m_jName.setText(null);
    this.m_CategoryModel.setSelectedKey(null);
    this.m_jNotes.setText(null);
    this.txtMaxdebt.setText(null);
    this.txtCurdebt.setText(null);
    this.txtCurdate.setText(null);
    this.m_jVisible.setSelected(true);
    this.jcard.setText(null);
    this.txtFirstName.setText(null);
    this.txtLastName.setText(null);
    this.txtEmail.setText(null);
    this.txtPhone.setText(null);
    this.txtPhone2.setText(null);
    this.txtFax.setText(null);
    this.txtAddress.setText(null);
    this.txtAddress2.setText(null);
    this.txtPostal.setText(null);
    this.txtCity.setText(null);
    this.txtRegion.setText(null);
    this.txtCountry.setText(null);
    this.m_jTaxID.setEnabled(true);
    this.m_jSearchkey.setEnabled(true);
    this.m_jName.setEnabled(true);
    this.m_jCategory.setEnabled(true);
    this.m_jNotes.setEnabled(true);
    this.txtMaxdebt.setEnabled(true);
    this.txtCurdebt.setEnabled(true);
    this.txtCurdate.setEnabled(true);
    this.m_jVisible.setEnabled(true);
    this.jcard.setEnabled(true);
    this.txtFirstName.setEnabled(true);
    this.txtLastName.setEnabled(true);
    this.txtEmail.setEnabled(true);
    this.txtPhone.setEnabled(true);
    this.txtPhone2.setEnabled(true);
    this.txtFax.setEnabled(true);
    this.txtAddress.setEnabled(true);
    this.txtAddress2.setEnabled(true);
    this.txtPostal.setEnabled(true);
    this.txtCity.setEnabled(true);
    this.txtRegion.setEnabled(true);
    this.txtCountry.setEnabled(true);
    this.jButton2.setEnabled(true);
    this.jButton3.setEnabled(true);
  }

  public void writeValueDelete(Object paramObject)
  {
    Object[] arrayOfObject = (Object[])(Object[])paramObject;
    this.m_oId = arrayOfObject[0];
    this.m_jTaxID.setText((String)arrayOfObject[1]);
    this.m_jSearchkey.setText((String)arrayOfObject[2]);
    this.m_jName.setText((String)arrayOfObject[3]);
    this.m_jNotes.setText((String)arrayOfObject[4]);
    this.m_jVisible.setSelected(((Boolean)arrayOfObject[5]).booleanValue());
    this.jcard.setText((String)arrayOfObject[6]);
    this.txtMaxdebt.setText(Formats.CURRENCY.formatValue(arrayOfObject[7]));
    this.txtCurdate.setText(Formats.DATE.formatValue(arrayOfObject[8]));
    this.txtCurdebt.setText(Formats.CURRENCY.formatValue(arrayOfObject[9]));
    this.txtFirstName.setText(Formats.STRING.formatValue(arrayOfObject[10]));
    this.txtLastName.setText(Formats.STRING.formatValue(arrayOfObject[11]));
    this.txtEmail.setText(Formats.STRING.formatValue(arrayOfObject[12]));
    this.txtPhone.setText(Formats.STRING.formatValue(arrayOfObject[13]));
    this.txtPhone2.setText(Formats.STRING.formatValue(arrayOfObject[14]));
    this.txtFax.setText(Formats.STRING.formatValue(arrayOfObject[15]));
    this.txtAddress.setText(Formats.STRING.formatValue(arrayOfObject[16]));
    this.txtAddress2.setText(Formats.STRING.formatValue(arrayOfObject[17]));
    this.txtPostal.setText(Formats.STRING.formatValue(arrayOfObject[18]));
    this.txtCity.setText(Formats.STRING.formatValue(arrayOfObject[19]));
    this.txtRegion.setText(Formats.STRING.formatValue(arrayOfObject[20]));
    this.txtCountry.setText(Formats.STRING.formatValue(arrayOfObject[21]));
    this.m_CategoryModel.setSelectedKey(arrayOfObject[22]);
    this.m_jTaxID.setEnabled(false);
    this.m_jSearchkey.setEnabled(false);
    this.m_jName.setEnabled(false);
    this.m_jNotes.setEnabled(false);
    this.txtMaxdebt.setEnabled(false);
    this.txtCurdebt.setEnabled(false);
    this.txtCurdate.setEnabled(false);
    this.m_jVisible.setEnabled(false);
    this.jcard.setEnabled(false);
    this.txtFirstName.setEnabled(false);
    this.txtLastName.setEnabled(false);
    this.txtEmail.setEnabled(false);
    this.txtPhone.setEnabled(false);
    this.txtPhone2.setEnabled(false);
    this.txtFax.setEnabled(false);
    this.txtAddress.setEnabled(false);
    this.txtAddress2.setEnabled(false);
    this.txtPostal.setEnabled(false);
    this.txtCity.setEnabled(false);
    this.txtRegion.setEnabled(false);
    this.txtCountry.setEnabled(false);
    this.m_jCategory.setEnabled(false);
    this.jButton2.setEnabled(false);
    this.jButton3.setEnabled(false);
  }

  public void writeValueEdit(Object paramObject)
  {
    Object[] arrayOfObject = (Object[])(Object[])paramObject;
    this.m_oId = arrayOfObject[0];
    this.m_jTaxID.setText((String)arrayOfObject[1]);
    this.m_jSearchkey.setText((String)arrayOfObject[2]);
    this.m_jName.setText((String)arrayOfObject[3]);
    this.m_jNotes.setText((String)arrayOfObject[4]);
    this.m_jVisible.setSelected(((Boolean)arrayOfObject[5]).booleanValue());
    this.jcard.setText((String)arrayOfObject[6]);
    this.txtMaxdebt.setText(Formats.CURRENCY.formatValue(arrayOfObject[7]));
    this.txtCurdate.setText(Formats.DATE.formatValue(arrayOfObject[8]));
    this.txtCurdebt.setText(Formats.CURRENCY.formatValue(arrayOfObject[9]));
    this.txtFirstName.setText(Formats.STRING.formatValue(arrayOfObject[10]));
    this.txtLastName.setText(Formats.STRING.formatValue(arrayOfObject[11]));
    this.txtEmail.setText(Formats.STRING.formatValue(arrayOfObject[12]));
    this.txtPhone.setText(Formats.STRING.formatValue(arrayOfObject[13]));
    this.txtPhone2.setText(Formats.STRING.formatValue(arrayOfObject[14]));
    this.txtFax.setText(Formats.STRING.formatValue(arrayOfObject[15]));
    this.txtAddress.setText(Formats.STRING.formatValue(arrayOfObject[16]));
    this.txtAddress2.setText(Formats.STRING.formatValue(arrayOfObject[17]));
    this.txtPostal.setText(Formats.STRING.formatValue(arrayOfObject[18]));
    this.txtCity.setText(Formats.STRING.formatValue(arrayOfObject[19]));
    this.txtRegion.setText(Formats.STRING.formatValue(arrayOfObject[20]));
    this.txtCountry.setText(Formats.STRING.formatValue(arrayOfObject[21]));
    this.m_CategoryModel.setSelectedKey(arrayOfObject[22]);
    this.m_jTaxID.setEnabled(true);
    this.m_jSearchkey.setEnabled(true);
    this.m_jName.setEnabled(true);
    this.m_jNotes.setEnabled(true);
    this.txtMaxdebt.setEnabled(true);
    this.txtCurdebt.setEnabled(true);
    this.txtCurdate.setEnabled(true);
    this.m_jVisible.setEnabled(true);
    this.jcard.setEnabled(true);
    this.txtFirstName.setEnabled(true);
    this.txtLastName.setEnabled(true);
    this.txtEmail.setEnabled(true);
    this.txtPhone.setEnabled(true);
    this.txtPhone2.setEnabled(true);
    this.txtFax.setEnabled(true);
    this.txtAddress.setEnabled(true);
    this.txtAddress2.setEnabled(true);
    this.txtPostal.setEnabled(true);
    this.txtCity.setEnabled(true);
    this.txtRegion.setEnabled(true);
    this.txtCountry.setEnabled(true);
    this.m_jCategory.setEnabled(true);
    this.jButton2.setEnabled(true);
    this.jButton3.setEnabled(true);
  }

  public Object createValue()
    throws BasicException
  {
    Object[] arrayOfObject = new Object[23];
    arrayOfObject[0] = (this.m_oId == null ? UUID.randomUUID().toString() : this.m_oId);
    arrayOfObject[1] = this.m_jTaxID.getText();
    arrayOfObject[2] = this.m_jSearchkey.getText();
    arrayOfObject[3] = this.m_jName.getText();
    arrayOfObject[4] = this.m_jNotes.getText();
    arrayOfObject[5] = Boolean.valueOf(this.m_jVisible.isSelected());
    arrayOfObject[6] = Formats.STRING.parseValue(this.jcard.getText());
    arrayOfObject[7] = Formats.CURRENCY.parseValue(this.txtMaxdebt.getText(), new Double(0.0D));
    arrayOfObject[8] = Formats.TIMESTAMP.parseValue(this.txtCurdate.getText());
    arrayOfObject[9] = Formats.CURRENCY.parseValue(this.txtCurdebt.getText());
    arrayOfObject[10] = Formats.STRING.parseValue(this.txtFirstName.getText());
    arrayOfObject[11] = Formats.STRING.parseValue(this.txtLastName.getText());
    arrayOfObject[12] = Formats.STRING.parseValue(this.txtEmail.getText());
    arrayOfObject[13] = Formats.STRING.parseValue(this.txtPhone.getText());
    arrayOfObject[14] = Formats.STRING.parseValue(this.txtPhone2.getText());
    arrayOfObject[15] = Formats.STRING.parseValue(this.txtFax.getText());
    arrayOfObject[16] = Formats.STRING.parseValue(this.txtAddress.getText());
    arrayOfObject[17] = Formats.STRING.parseValue(this.txtAddress2.getText());
    arrayOfObject[18] = Formats.STRING.parseValue(this.txtPostal.getText());
    arrayOfObject[19] = Formats.STRING.parseValue(this.txtCity.getText());
    arrayOfObject[20] = Formats.STRING.parseValue(this.txtRegion.getText());
    arrayOfObject[21] = Formats.STRING.parseValue(this.txtCountry.getText());
    arrayOfObject[22] = this.m_CategoryModel.getSelectedKey();
    return arrayOfObject;
  }

  public Component getComponent()
  {
    return this;
  }

  private void initComponents()
  {
    this.jLabel7 = new JLabel();
    this.m_jTaxID = new JTextField();
    this.jLabel8 = new JLabel();
    this.m_jSearchkey = new JTextField();
    this.jLabel3 = new JLabel();
    this.m_jName = new JTextField();
    this.jLabel4 = new JLabel();
    this.m_jVisible = new JCheckBox();
    this.jLabel5 = new JLabel();
    this.jcard = new JTextField();
    this.jLabel9 = new JLabel();
    this.m_jCategory = new JComboBox();
    this.jButton2 = new JButton();
    this.jButton3 = new JButton();
    this.jLabel1 = new JLabel();
    this.txtMaxdebt = new JTextField();
    this.jTabbedPane1 = new JTabbedPane();
    this.jPanel1 = new JPanel();
    this.jLabel14 = new JLabel();
    this.txtFax = new JTextField();
    this.jLabel15 = new JLabel();
    this.txtLastName = new JTextField();
    this.jLabel16 = new JLabel();
    this.txtEmail = new JTextField();
    this.jLabel17 = new JLabel();
    this.txtPhone = new JTextField();
    this.jLabel18 = new JLabel();
    this.txtPhone2 = new JTextField();
    this.jLabel19 = new JLabel();
    this.txtFirstName = new JTextField();
    this.jPanel2 = new JPanel();
    this.jLabel13 = new JLabel();
    this.txtAddress = new JTextField();
    this.jLabel20 = new JLabel();
    this.txtCountry = new JTextField();
    this.jLabel21 = new JLabel();
    this.txtAddress2 = new JTextField();
    this.jLabel22 = new JLabel();
    this.txtPostal = new JTextField();
    this.jLabel23 = new JLabel();
    this.txtCity = new JTextField();
    this.jLabel24 = new JLabel();
    this.txtRegion = new JTextField();
    this.jPanel3 = new JPanel();
    this.jScrollPane1 = new JScrollPane();
    this.m_jNotes = new JTextArea();
    this.jLabel2 = new JLabel();
    this.txtCurdebt = new JTextField();
    this.jLabel6 = new JLabel();
    this.txtCurdate = new JTextField();
    this.jLabel7.setText(AppLocal.getIntString("label.taxid"));
    this.jLabel8.setText(AppLocal.getIntString("label.searchkey"));
    this.jLabel3.setText(AppLocal.getIntString("label.name"));
    this.jLabel4.setText(AppLocal.getIntString("label.visible"));
    this.jLabel5.setText(AppLocal.getIntString("label.card"));
    this.jcard.setEditable(false);
    this.jLabel9.setText(AppLocal.getIntString("label.custtaxcategory"));
    this.jButton2.setIcon(new ImageIcon(getClass().getResource("/com/openbravo/images/color_line16.png")));
    this.jButton2.addActionListener(new ActionListener()
    {
      public void actionPerformed(ActionEvent paramActionEvent)
      {
        CustomersView.this.jButton2ActionPerformed(paramActionEvent);
      }
    });
    this.jButton3.setIcon(new ImageIcon(getClass().getResource("/com/openbravo/images/fileclose.png")));
    this.jButton3.addActionListener(new ActionListener()
    {
      public void actionPerformed(ActionEvent paramActionEvent)
      {
        CustomersView.this.jButton3ActionPerformed(paramActionEvent);
      }
    });
    this.jLabel1.setText(AppLocal.getIntString("label.maxdebt"));
    this.txtMaxdebt.setHorizontalAlignment(4);
    this.jLabel14.setText(AppLocal.getIntString("label.fax"));
    this.jLabel15.setText(AppLocal.getIntString("label.lastname"));
    this.jLabel16.setText(AppLocal.getIntString("label.email"));
    this.jLabel17.setText(AppLocal.getIntString("label.phone"));
    this.jLabel18.setText(AppLocal.getIntString("label.phone2"));
    this.jLabel19.setText(AppLocal.getIntString("label.firstname"));
    GroupLayout localGroupLayout1 = new GroupLayout(this.jPanel1);
    this.jPanel1.setLayout(localGroupLayout1);
    localGroupLayout1.setHorizontalGroup(localGroupLayout1.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(localGroupLayout1.createSequentialGroup().addContainerGap().addGroup(localGroupLayout1.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(localGroupLayout1.createSequentialGroup().addComponent(this.jLabel19, -2, 140, -2).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(this.txtFirstName, -2, 270, -2)).addGroup(localGroupLayout1.createSequentialGroup().addComponent(this.jLabel15, -2, 140, -2).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(this.txtLastName, -2, 270, -2)).addGroup(localGroupLayout1.createSequentialGroup().addComponent(this.jLabel16, -2, 140, -2).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(this.txtEmail, -2, 270, -2)).addGroup(localGroupLayout1.createSequentialGroup().addComponent(this.jLabel17, -2, 140, -2).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(this.txtPhone, -2, 270, -2)).addGroup(localGroupLayout1.createSequentialGroup().addComponent(this.jLabel18, -2, 140, -2).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(this.txtPhone2, -2, 270, -2)).addGroup(localGroupLayout1.createSequentialGroup().addComponent(this.jLabel14, -2, 140, -2).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(this.txtFax, -2, 270, -2))).addContainerGap(249, 32767)));
    localGroupLayout1.setVerticalGroup(localGroupLayout1.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(localGroupLayout1.createSequentialGroup().addContainerGap().addGroup(localGroupLayout1.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(this.jLabel19).addComponent(this.txtFirstName, -2, -1, -2)).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addGroup(localGroupLayout1.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(this.jLabel15).addComponent(this.txtLastName, -2, -1, -2)).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addGroup(localGroupLayout1.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(this.jLabel16).addComponent(this.txtEmail, -2, -1, -2)).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addGroup(localGroupLayout1.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(this.jLabel17).addComponent(this.txtPhone, -2, -1, -2)).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addGroup(localGroupLayout1.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(this.jLabel18).addComponent(this.txtPhone2, -2, -1, -2)).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addGroup(localGroupLayout1.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(this.jLabel14).addComponent(this.txtFax, -2, -1, -2)).addContainerGap(-1, 32767)));
    this.jTabbedPane1.addTab(AppLocal.getIntString("label.contact"), this.jPanel1);
    this.jLabel13.setText(AppLocal.getIntString("label.address"));
    this.jLabel20.setText(AppLocal.getIntString("label.country"));
    this.jLabel21.setText(AppLocal.getIntString("label.address2"));
    this.jLabel22.setText(AppLocal.getIntString("label.postal"));
    this.jLabel23.setText(AppLocal.getIntString("label.city"));
    this.jLabel24.setText(AppLocal.getIntString("label.region"));
    GroupLayout localGroupLayout2 = new GroupLayout(this.jPanel2);
    this.jPanel2.setLayout(localGroupLayout2);
    localGroupLayout2.setHorizontalGroup(localGroupLayout2.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(localGroupLayout2.createSequentialGroup().addContainerGap().addGroup(localGroupLayout2.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(localGroupLayout2.createSequentialGroup().addComponent(this.jLabel13, -2, 140, -2).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(this.txtAddress, -2, 270, -2)).addGroup(localGroupLayout2.createSequentialGroup().addComponent(this.jLabel21, -2, 140, -2).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(this.txtAddress2, -2, 270, -2)).addGroup(localGroupLayout2.createSequentialGroup().addComponent(this.jLabel22, -2, 140, -2).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(this.txtPostal, -2, 270, -2)).addGroup(localGroupLayout2.createSequentialGroup().addComponent(this.jLabel23, -2, 140, -2).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(this.txtCity, -2, 270, -2)).addGroup(localGroupLayout2.createSequentialGroup().addComponent(this.jLabel24, -2, 140, -2).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(this.txtRegion, -2, 270, -2)).addGroup(localGroupLayout2.createSequentialGroup().addComponent(this.jLabel20, -2, 140, -2).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(this.txtCountry, -2, 270, -2))).addContainerGap(249, 32767)));
    localGroupLayout2.setVerticalGroup(localGroupLayout2.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(localGroupLayout2.createSequentialGroup().addContainerGap().addGroup(localGroupLayout2.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(this.jLabel13).addComponent(this.txtAddress, -2, -1, -2)).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addGroup(localGroupLayout2.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(this.jLabel21).addComponent(this.txtAddress2, -2, -1, -2)).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addGroup(localGroupLayout2.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(this.jLabel22).addComponent(this.txtPostal, -2, -1, -2)).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addGroup(localGroupLayout2.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(this.jLabel23).addComponent(this.txtCity, -2, -1, -2)).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addGroup(localGroupLayout2.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(this.jLabel24).addComponent(this.txtRegion, -2, -1, -2)).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addGroup(localGroupLayout2.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(this.jLabel20).addComponent(this.txtCountry, -2, -1, -2)).addGap(267, 267, 267)));
    this.jTabbedPane1.addTab(AppLocal.getIntString("label.location"), this.jPanel2);
    this.jScrollPane1.setViewportView(this.m_jNotes);
    GroupLayout localGroupLayout3 = new GroupLayout(this.jPanel3);
    this.jPanel3.setLayout(localGroupLayout3);
    localGroupLayout3.setHorizontalGroup(localGroupLayout3.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(localGroupLayout3.createSequentialGroup().addContainerGap().addComponent(this.jScrollPane1, -1, 659, 32767).addContainerGap()));
    localGroupLayout3.setVerticalGroup(localGroupLayout3.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(localGroupLayout3.createSequentialGroup().addContainerGap().addComponent(this.jScrollPane1, -1, 144, 32767).addContainerGap()));
    this.jTabbedPane1.addTab(AppLocal.getIntString("label.notes"), this.jPanel3);
    this.jLabel2.setText(AppLocal.getIntString("label.curdebt"));
    this.txtCurdebt.setEditable(false);
    this.txtCurdebt.setHorizontalAlignment(4);
    this.jLabel6.setText(AppLocal.getIntString("label.curdate"));
    this.txtCurdate.setEditable(false);
    this.txtCurdate.setHorizontalAlignment(0);
    GroupLayout localGroupLayout4 = new GroupLayout(this);
    setLayout(localGroupLayout4);
    localGroupLayout4.setHorizontalGroup(localGroupLayout4.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(localGroupLayout4.createSequentialGroup().addContainerGap().addGroup(localGroupLayout4.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(this.jTabbedPane1, -1, 688, 32767).addGroup(localGroupLayout4.createParallelGroup(GroupLayout.Alignment.LEADING, false).addGroup(localGroupLayout4.createSequentialGroup().addComponent(this.jLabel7, -2, 180, -2).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(this.m_jTaxID, -2, 270, -2)).addGroup(localGroupLayout4.createSequentialGroup().addComponent(this.jLabel8, -2, 180, -2).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(this.m_jSearchkey, -2, 270, -2)).addGroup(localGroupLayout4.createSequentialGroup().addComponent(this.jLabel3, -2, 180, -2).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(this.m_jName, -2, 270, -2)).addGroup(localGroupLayout4.createSequentialGroup().addComponent(this.jLabel4, -2, 180, -2).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, -1, 32767).addComponent(this.m_jVisible, -2, 140, -2).addGap(246, 246, 246)).addGroup(localGroupLayout4.createSequentialGroup().addGroup(localGroupLayout4.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(localGroupLayout4.createSequentialGroup().addComponent(this.jLabel5, -2, 180, -2).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(this.jcard, -2, 270, -2)).addGroup(localGroupLayout4.createSequentialGroup().addComponent(this.jLabel9, -2, 180, -2).addGap(12, 12, 12).addComponent(this.m_jCategory, -2, 270, -2))).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(this.jButton2).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(this.jButton3))).addGroup(localGroupLayout4.createSequentialGroup().addComponent(this.jLabel1, -2, 180, -2).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(this.txtMaxdebt, -2, 130, -2)).addGroup(localGroupLayout4.createSequentialGroup().addComponent(this.jLabel2, -2, 180, -2).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(this.txtCurdebt, -2, 130, -2)).addGroup(localGroupLayout4.createSequentialGroup().addComponent(this.jLabel6, -2, 180, -2).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(this.txtCurdate, -2, 130, -2))).addContainerGap()));
    localGroupLayout4.setVerticalGroup(localGroupLayout4.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(localGroupLayout4.createSequentialGroup().addContainerGap().addGroup(localGroupLayout4.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(this.jLabel7).addComponent(this.m_jTaxID, -2, -1, -2)).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addGroup(localGroupLayout4.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(this.jLabel8).addComponent(this.m_jSearchkey, -2, -1, -2)).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addGroup(localGroupLayout4.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(this.jLabel3).addComponent(this.m_jName, -2, -1, -2)).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addGroup(localGroupLayout4.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(localGroupLayout4.createSequentialGroup().addGroup(localGroupLayout4.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(this.jLabel5).addComponent(this.jcard, -2, -1, -2)).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addGroup(localGroupLayout4.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(this.jLabel9).addComponent(this.m_jCategory, -2, 20, -2))).addComponent(this.jButton2).addComponent(this.jButton3)).addGap(6, 6, 6).addGroup(localGroupLayout4.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(this.jLabel4).addComponent(this.m_jVisible, -2, 20, -2)).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addGroup(localGroupLayout4.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(this.jLabel1).addComponent(this.txtMaxdebt, -2, -1, -2)).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addGroup(localGroupLayout4.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(this.jLabel2).addComponent(this.txtCurdebt, -2, -1, -2)).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addGroup(localGroupLayout4.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(this.jLabel6).addComponent(this.txtCurdate, -2, -1, -2)).addGap(18, 18, 18).addComponent(this.jTabbedPane1, -2, 195, -2).addContainerGap()));
  }

  private void jButton2ActionPerformed(ActionEvent paramActionEvent)
  {
    if (JOptionPane.showConfirmDialog(this, AppLocal.getIntString("message.cardnew"), AppLocal.getIntString("title.editor"), 0, 3) == 0)
    {
      this.jcard.setText("c" + StringUtils.getCardNumber());
      this.m_Dirty.setDirty(true);
    }
  }

  private void jButton3ActionPerformed(ActionEvent paramActionEvent)
  {
    if (JOptionPane.showConfirmDialog(this, AppLocal.getIntString("message.cardremove"), AppLocal.getIntString("title.editor"), 0, 3) == 0)
    {
      this.jcard.setText(null);
      this.m_Dirty.setDirty(true);
    }
  }
}

/* Location:           D:\PowerFulPOS-2.30.2\openbravopos.jar
 * Qualified Name:     com.openbravo.pos.customers.CustomersView
 * JD-Core Version:    0.6.0
 */